<%
sign_up_url = url_for :controller => :sign_up, :action => :new_account
form_tag(sign_up_url, :method => "post") do %>

<% field_set_tag I18n.t(:tr_your_information) do %>

<p>
<%= label_tag(:fullname, I18n.t(:tr_full_name) + ":") %>
<%= text_field_tag(:fullname, @user.fullname) %>
</p>

<p>
<%= label_tag(:nickname, I18n.t(:tr_nickname) + ":") %>
<%= text_field_tag(:nickname, @user.nickname) %><br />

<p>
<%= label_tag(:email, I18n.t(:tr_email) + ":") %>
<%= text_field_tag(:email, @user.email) %><br />
</p>

<p>
<%= label_tag(:language_id, I18n.t(:tr_language) + ":") %>
<%= select_tag(:language_id, options_from_collection_for_select(Language.all, :id, :name, @user.language.id)) %><br />
</p>

<p>
<%= label_tag(:favclub, I18n.t(:tr_favclub) + ":") %>
<%= text_field_tag(:favclub, (@user.favorite_club.nil?)?params['favclub']:@user.favorite_club.name) %><br />
</p>

<%= hidden_field_tag 'club_id', (@user.favorite_club.nil?)?'':@user.favorite_club.id %>

<p style="padding-left: 9.9em;">
<%= submit_tag(I18n.t(:tr_sign_up)) %>
<div id="favclub_menu">
</div>
<script type="text/javascript">
   window.onload = function() {
      new Ajax.Autocompleter(
        "favclub",
        "favclub_menu",
        "/list_clubs/list",
        {ignoreCase:false, afterUpdateElement : getSelectionId}
      );
   }
   function getSelectionId(text, li) {     
     document.getElementById("club_id").value = li.id.toString().substr(5);     
   }
</script>

<% end  %>
<% end  %>
